package bootstrap

import (
	"Walker/bootstrap/bootstrap"
	"Walker/global"
	"Walker/interfaces"
)

func init() {
	println(2222)
	//初始化根目录
	//初始化配置文件
	bootstrap.BasePath()
	//配置文件读取
	global.ConfigValue = bootstrap.YmlConfFunc()
	//数据库配置初始化
	global.DatabaseValue = bootstrap.YmlConfFunc("database")
	//初始化日志文件配置
	global.Logger = bootstrap.Logger()
	global.InitLogger = interfaces.Logger{
		StoragePath: global.StoragePath,
	}
	//数据库初始化
	global.DB = bootstrap.ConnectMysql()
	//Casbin
	//if global.ConfigValue.GetBool("Casbin.isInit") == true {
	//	global.Enforcer = bootstrap.InitCasbin()
	//}
	//if global.ConfigValue.GetBool("Redis.isInit") == true {
	//	global.ConfigRedis = bootstrap.ConnectRedis()
	//}
}
